#!/bin/sh
# dist: public

EXE=$1
PID=$2
TMP=gdbcmds.$$.tmp

exec >segv-$PID.bt 2>&1

echo >$TMP '
set height 0
thread apply all bt full
quit
'

gdb -batch -x $TMP $EXE $PID </dev/null
rm -f $TMP
